package com.workflow.workflowproject.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Table(value = "t_com_flow_info")
public class FlowInfo implements Serializable {
    private static final long serialVersionUID = 7496003589135898516L;

    @Id(keyType = KeyType.Auto)
    private Integer id;

    @Column(value = "no")
    @Schema(description = "编号")
    private String no;

    @Column(value = "name")
    @Schema(description = "流程名称")
    private String name;

    @Column(value = "is_pc")
    @Schema(description = "pc端适配（0、启用；1、不启用）")
    private Integer isPc;

    @Column(value = "is_move")
    @Schema(description = "移动端适配（0、启用；1、不启用）")
    private Integer isMove;

    @Column(value = "type")
    @Schema(description = "流程类型名称")
    private String type;

    @Column(value = "current_version")
    @Schema(description = "当前版本id")
    private String currentVersion;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(value = "create_time",onInsertValue = "now()")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(value = "update_time",onUpdateValue = "now()")
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    @Column(value = "exist",isLogicDelete = true)
    @Schema(description = "是否删除")
    private Integer exist;
}